import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import Vant from "vant";
import "vant/lib/index.css";
import { serverUrl } from "./Uitils/request";

Vue.config.productionTip = false;

Vue.use(Vant);
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");

//全局过滤器
Vue.filter("dalImg", (url) => {
  if (url) {
    if (url.startsWith("http")) {
      return url;
    } else {
      return serverUrl + url;
    }
  } else {
    return "https://image.baidu.com/search/detail?ct=503316480&z=undefined&tn=baiduimagedetail&ipn=d&word=%E7%94%9F%E8%9A%9D&step_word=&ie=utf-8&in=&cl=2&lm=-1&st=undefined&hd=undefined&latest=undefined&copyright=undefined&cs=3211218249,2770842555&os=3677308483,2593668071&simid=3347266832,4049827718&pn=4&rn=1&di=7060663421280190465&ln=1801&fr=&fmq=1649753607248_R&fm=&ic=undefined&s=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&is=0,0&istype=0&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=0&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%253A%252F%252Fimg.leha.com%252Fc1b%252F05b03884b2c81.jpg%26refer%3Dhttp%253A%252F%252Fimg.leha.com%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Dauto%3Fsec%3D1652345604%26t%3D35bd5ca5bccc945858dc5a9a3188e6d2&rpstart=0&rpnum=0&adpicid=0&nojc=undefined&dyTabStr=MCwzLDQsNiw1LDgsMSw3LDIsOQ%3D%3D";
  }
});
